package com.hqizcc.ltcs.hqbsltcs.controller;

import com.hqizcc.ltcs.hqbsltcs.service.GetCountyService;
import com.hqizcc.ltcs.hqbsltcs.service.GetTownService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class GetTownController {

    @Autowired
    private GetTownService getTownService;

    @RequestMapping(value = "getTown")
    public String getTown(){

        boolean result = getTownService.getTown();

        if (result){

            System.out.println("爬取成功");

            return "index";

        } else {

            System.out.println("爬取失败");

            return "error";

        }

    }


}
